class Car:
	"""汽车"""
	def __init__(self, name, model, year):
		self.name = name
		self.model = model
		self.year = year
	def dscribe(self):
		print(f"{self.year} {self.name} {self.model}")

class Battery:
	"""电瓶"""
	def __init__(self, battery_size=75):
		self.battery_size = battery_size

	def describe_battery(self):
		print(f"这辆车有 {self.battery_size}-kWh 容量.")

	def get_range(self):
		if self.battery_size == 75:
			range = 260
		elif self.battery_size == 100:
			range = 315
		print(f"这辆车在满电下续航里程是:{range} miles")

	def upgrade_battery(self):
		if self.battery_size < 100:
			self.battery_size = 100

class ElectricCar(Car):
	def __init__(self, name, model, year):
		super().__init__(name, model, year)
		self.battery = Battery()

car = ElectricCar("特斯拉", "model 3", 2019)
car.dscribe()
car.battery.describe_battery()
car.battery.get_range()
car.battery.upgrade_battery()
car.battery.get_range()